package cn.gson.springboot.model.pjos;

import javax.persistence.*;
import java.util.List;
import java.util.Objects;

@Entity
public class Specifications {
    private int speId;
    private String speColor;
    private String speEngine;
    private Integer speLong;
    private Integer speWidth;
    private Integer speHeight;
    private Integer speWheelbase;
    private Integer speDisplacement;
    private String speType;
    private String speTransmission;
    private List<Productside> productsideByspeId;

    @OneToMany(mappedBy = "specificationsByspeId")
    public List<Productside> getProductsideByspeId() {
        return productsideByspeId;
    }

    public void setProductsideByspeId(List<Productside> productsideByspeId) {
        this.productsideByspeId = productsideByspeId;
    }

    @Id
    @Column(name = "Spe_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "seq")
    public int getSpeId() {
        return speId;
    }

    public void setSpeId(int speId) {
        this.speId = speId;
    }

    @Basic
    @Column(name = "Spe_color")
    public String getSpeColor() {
        return speColor;
    }

    public void setSpeColor(String speColor) {
        this.speColor = speColor;
    }

    @Basic
    @Column(name = "Spe_engine")
    public String getSpeEngine() {
        return speEngine;
    }

    public void setSpeEngine(String speEngine) {
        this.speEngine = speEngine;
    }

    @Basic
    @Column(name = "Spe_long")
    public Integer getSpeLong() {
        return speLong;
    }

    public void setSpeLong(Integer speLong) {
        this.speLong = speLong;
    }

    @Basic
    @Column(name = "Spe_width")
    public Integer getSpeWidth() {
        return speWidth;
    }

    public void setSpeWidth(Integer speWidth) {
        this.speWidth = speWidth;
    }

    @Basic
    @Column(name = "Spe_height")
    public Integer getSpeHeight() {
        return speHeight;
    }

    public void setSpeHeight(Integer speHeight) {
        this.speHeight = speHeight;
    }

    @Basic
    @Column(name = "Spe_wheelbase")
    public Integer getSpeWheelbase() {
        return speWheelbase;
    }

    public void setSpeWheelbase(Integer speWheelbase) {
        this.speWheelbase = speWheelbase;
    }

    @Basic
    @Column(name = "Spe_displacement")
    public Integer getSpeDisplacement() {
        return speDisplacement;
    }

    public void setSpeDisplacement(Integer speDisplacement) {
        this.speDisplacement = speDisplacement;
    }

    @Basic
    @Column(name = "Spe_type")
    public String getSpeType() {
        return speType;
    }

    public void setSpeType(String speType) {
        this.speType = speType;
    }

    @Basic
    @Column(name = "Spe_transmission")
    public String getSpeTransmission() {
        return speTransmission;
    }

    public void setSpeTransmission(String speTransmission) {
        this.speTransmission = speTransmission;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Specifications that = (Specifications) o;
        return speId == that.speId &&
                Objects.equals(speColor, that.speColor) &&
                Objects.equals(speEngine, that.speEngine) &&
                Objects.equals(speLong, that.speLong) &&
                Objects.equals(speWidth, that.speWidth) &&
                Objects.equals(speHeight, that.speHeight) &&
                Objects.equals(speWheelbase, that.speWheelbase) &&
                Objects.equals(speDisplacement, that.speDisplacement) &&
                Objects.equals(speType, that.speType) &&
                Objects.equals(speTransmission, that.speTransmission);
    }

    @Override
    public int hashCode() {
        return Objects.hash(speId, speColor, speEngine, speLong, speWidth, speHeight, speWheelbase, speDisplacement, speType, speTransmission);
    }


}
